Sleep loss diminishes hippocampal reactivation and replay

Memories benefit from sleep, and sleep loss immediately following learning has a negative impact on subsequent memory storage. Several prominent hypotheses ascribe a central role to hippocampal sharp-wave ripples (SWRs), and the concurrent reactivation and replay of neuronal patterns from waking experience, in the offline memory consolidation process that occurs during sleep. However, little is known about how SWRs, reactivation, and replay are affected when animals are subjected to sleep deprivation. We performed long duration (~12 h), high-density silicon probe recordings from rat hippocampal CA1 neurons, in animals that were either sleeping or sleep deprived following exposure to a novel maze environment. We found that SWRs showed a sustained rate of activity during sleep deprivation, similar to or higher than in natural sleep, but with decreased amplitudes for the sharp-waves combined with higher frequencies for the ripples. Furthermore, while hippocampal pyramidal cells showed a log-normal distribution of firing rates during sleep, these distributions were negatively skewed with a higher mean firing rate in both pyramidal cells and interneurons during sleep deprivation. During SWRs, however, firing rates were remarkably similar between both groups. Despite the abundant quantity of SWRs and the robust firing activity during these events in both groups, we found that reactivation of neurons was either completely abolished or significantly diminished during sleep deprivation compared to sleep. Interestingly, reactivation partially rebounded upon recovery sleep, but failed to reach the levels characteristic of natural sleep. Similarly, the number of replays were significantly lower during sleep deprivation and recovery sleep compared to natural sleep. These results provide a network-level account for the negative impact of sleep loss on hippocampal function and demonstrate that sleep loss impacts memory storage by causing a dissociation between the amount of SWRs and the replays and reactivations that take place during these events.

that SWRs showed a sustained rate of activity during sleep deprivation, similar to or higher than 23 in natural sleep, but with decreased amplitudes for the sharp-waves combined with higher 24 frequencies for the ripples. Furthermore, while hippocampal pyramidal cells showed a log-25 normal distribution of firing rates during sleep, these distributions were negatively skewed with 26 a higher mean firing rate in both pyramidal cells and interneurons during sleep deprivation. 27 During SWRs, however, firing rates were remarkably similar between both groups. Despite the 28 abundant quantity of SWRs and the robust firing activity during these events in both groups, we 29 found that reactivation of neurons was either completely abolished or significantly diminished 30 during sleep deprivation compared to sleep. Interestingly, reactivation partially rebounded 31 upon recovery sleep, but failed to reach the levels characteristic of natural sleep. Similarly, the 32 number of replays were significantly lower during sleep deprivation and recovery sleep 33 compared to natural sleep. These results provide a network-level account for the negative 34 impact of sleep loss on hippocampal function and demonstrate that sleep loss impacts memory 35 storage by causing a dissociation between the amount of SWRs and the replays and 36 reactivations that take place during these events. 37 Main: 38 Memories undergo continuous refinement following learning, in a process referred to as 39 memory consolidation in which sleep plays a critical role. Sleep immediately after learning 40 benefits memories 1 and memories can be disrupted by even a few hours of sleep loss 2 . Studies 41 have highlighted the particular importance of the hippocampus for sleep-dependent memory 42 consolidation. However, the mechanisms through which memories are impacted by sleep loss 43 have yet to be understood. At the cellular level, studies have identified molecular signaling 44 events that are impacted by sleep loss, particularly in the first several hours. At the circuits 45 level, oscillatory activities during sleep are hypothesized to strengthen, stabilize, and optimize 46 memories. Hippocampal sharp-wave ripples (SWRs), which feature sharp-waves in the 47 dendrites of CA1 pyramidal cells coupled with ripple oscillations (150-250 Hz) near the cell 48 bodies, are widely considered to play a critical role in sleep-dependent memory processes. 49 SWRs are observed more frequently in sleep after memory tasks 3 . Disrupting activity during 50 these oscillations impairs memory 4,5 , while enhancing them improves memory 6 . 51 Why are hippocampal sharp-wave ripples so important to memory? A key characteristic of 52 these signals is that they are generated in the CA3 region of the hippocampus and then produce 53 intense spiking activity in the pyramidal cells and interneurons throughout the hippocampal 54 formation 7,8 and beyond 9,10 . Such synchronized activity drives synaptic plasticity in the 55 connections between neurons associated with individual memories, thereby enhancing the 56 signal to noise for storage and recall of those memories in the network 11,12 . In fact, both 57 synaptic strengthening, via long-term potentiation 13,14 and synaptic weakening, via 58 depotentiation or long-term depression 15,16 , have been associated with SWRs. Moreover, the 59 spiking activity during SWRs can be highly patterned to reactivate and replay activities initially 60 expressed during learning and behavior in a temporally compressed manner akin to rapid 61 rehearsal 17 . By generating such rapid rehearsals, SWRs can strengthen and stabilize spatial 62 representations in the hippocampus 5,18 , as well as broadcast this signal to cortical and 63 subcortical brain regions 8,9,19 to transfer, transform, and consolidate memories 1 . While SWRs 64 and their associated reactivations and replays are widely considered to play a key role in the 65 memory consolidation process, remarkably nothing is known about how these events are 66 impacted by sleep deprivation. 67 Here, we provide a detailed account of the impact of sleep loss on hippocampal oscillations and 68 firing patterns, including sharp-wave ripples and associated reactivation and replay. We 69 performed unit and local field recordings from large populations of hippocampal neurons over 70 unprecedented (~ 12 h) durations, starting during sleep at the end of the dark cycle and 71 extending through to exploration of a novel maze, and sleep or sleep deprivation followed by 72 recovery sleep. We observed differences in the physiological characteristics of sharp-wave 73 ripples during sleep deprivation as compared to natural sleep: the amplitude of sharp-wave and 74 the power of the ripples were higher in natural sleep whereas the frequency of ripple 75 oscillations was higher during sleep deprivation. However, the rate of sharp-wave ripples during 76 sleep deprivation was similar or higher compared to natural sleep, indicating that the key 77 hippocampal mechanisms for memory consolidation remain intact during sleep deprivation. 78 Analysis of firing rates showed that both pyramidal cells and interneurons fired at higher rates 79 during sleep deprivation, resulting in a negatively skewed log distribution in pyramidal cells 80 compared to log-normal distributions typical of natural sleep. Analysis of firing patterns, 81 however, revealed that reactivation and replay were negatively impacted by sleep loss. 82 Whereas sleeping animals displayed robust reactivation in sleep following novel maze 83 exploration, sleep-deprived animals displayed either no reactivation or reactivation that 84 decayed at a faster rate. A similar impact was observed on multi-neuronal trajectory replays; 85 fewer significant replays were observed during sleep deprivation compared to natural sleep. 86 Remarkably, reactivation, but not replay, partially rebounded during the subsequent recovery 87 sleep, potentially indicating homeostatic maintenance. However, the amount of reactivation in 88 recovery sleep remained significantly attenuated compared to the levels seen during natural 89 sleep. 90 Overall, our study reveals the impact of sleep loss on hippocampal sharp-wave ripple events 91 and associated reactivation and replay, thereby elucidating the mechanism by which sleep loss 92 can impair hippocampus-dependent memory consolidation. 93

94
We performed extracellular recordings from units and local field potentials using 128 channel 95 high-density silicon probes (Diagnostic Biochips, MD) uni-and bilaterally implanted in the CA1 96 region of the rat hippocampus during behavior and sleep. Recordings initiated 3.5 h before 97 the onset of the light cycle with 2.5 h of rest and sleep in a homecage (PRE). Animals were 98 then placed in novel linear maze environments of differing shapes (MAZE) that they had not 99 previously explored, and allowed to run for ~1h for water reward. Following the maze, animals 100 were returned to the homecage for POST sessions that involved either natural sleep and rest 101 (NSD) for ~9 h, or sleep deprivation (SD) via gentle handling for 5 h followed by recovery sleep 102 (RS) (Fig. 1A). We separated these periods into blocks of 2.5 h (e.g. NS1-NS3 vs SD1-2 & RS). SD 103 and NSD sessions were carried out in pseudo-random order on different days spaced > 24 h 104 apart, in the same animals (16 sessions in 7 rats). Units were identified based on automated 105 and manual clustering and those that met strict criteria for stability were putatively classified 106 into 754 pyramidal neurons (PN) and 96 interneurons (IN) using standard techniques 107 (Methods). Power spectral calculations (Fig. 1B, C) demonstrated strong delta (<4 Hz) power in 108   during REM sleep. We did not see evidence for either prominent delta during sleep deprivation 133 nor for prominent theta outside of REM periods 20 . However, we note that delta activity during 134 sleep can spill over spectral power into neighboring theta frequency bins 21 . In our recordings, 135 sleep deprivation was characterized by lower spectral power across frequencies. Recovery sleep 136 following sleep deprivation subsequently featured a robust rebound in delta activity, consistent 137 with models of sleep homeostasis 22,23 . 138

A high rate of sharp-wave ripples is preserved during sleep deprivation. 139
Hippocampal sharp-wave ripple (SWR) complexes-sharp waves in the CA1 stratum radiatum 140 accompanied by fast ripple oscillations (150-250 Hz) in the stratum pyramidale 24 -are 141 observable during both awake and sleep states. Given the importance of SWRs for synaptic 142 modifications of circuits in both the hippocampus and other brain regions 25 and their 143 hypothesized roles in sleep-dependent memory consolidation processes, we first focused on 144 evaluating these events during our recordings (Fig. 1D). Previous studies have suggested that 145 the incidence rate of ripples and associated population burst events play important 146 homeostatic roles in hippocampal dynamics 15,16,26 . We therefore asked how the rate of these 147 events change during sleep compared to a similar period during extended wakefulness. In 148 naturally sleeping animals, we found that the incidence rate of SWRs decreased over time (Fig.  149  1E

Sleep loss alters the physiological properties of sharp-wave ripples 161
Given the prevalence of SWRs during both sleep and sleep deprivation, we hypothesized that 162 other characteristics of these hippocampal events might differ across these periods. Differences 163 in the physiological properties of SWRs have been observed in animal models of neurocognitive 164 disorders 27-29 and could reflect underlying circuit alterations. We therefore leveraged high-165 density electrodes in our recordings to measure and track changes in ripple frequency, ripple 166 power, and the amplitudes of sharp waves across the duration of our recordings (Fig. 1F). 167 Ripple oscillations in stratum pyramidale reflect rapid circuit dynamics that mediated by 168 coupling between pyramidal cells and inhibitory interneurons 30,31, see also 32 . The peak 169 frequency of ripples in our recordings (Fig. 1G)  interneuron interactions that give rise to ripple oscillations. 184 The sharp waves concurrent with ripples reflect Schaffer collateral input from CA3 converging 185 on the apical dendrites of CA1 neurons. The amplitude of these events therefore reflects the 186 capacity of the CA3 network for synchronization. To better understand the impact of sleep and 187 sleep loss we measured the amplitude of the sharp wave using the difference between the 188 most negative deflection (typically in stratum radiatum) and the most positive deflection 189 (typically in stratum oriens) recorded on our electrodes spanning CA1. In POST sleep we found 190 increased amplitudes of sharp waves compared to PRE (NS1 vs PRE, median = 5.1 (IQR = 3.44) 191 vs median = 4.13 (IQR = 3.03), < 10 −10 , t-test (df1 = 41430, df2 = 30390)), which 192 subsequently decreased over the course of natural sleep (NS1 median = 5.1 mV (IQR = 3.44) vs 193 NS3 median = 4.87 mV (IQR = 3.35), < 10 −10 , t-test (df1 = 41430, df2 = 29361)) ( Fig. 1H). between excitatory and inhibitory cell populations during these events. 212

Sleep loss disturbs firing-rate dynamics in the hippocampal network 213
The firing rates of neurons are sensitive to changes in sleep states 34 (Fig. 2). Pyramidal cell firing 220 rates ( Fig. 2A  competition among neurons 34 . In interneurons as well (Fig. 2C) Therefore, we also examined the firing responses of interneurons, alongside those of pyramidal 272 cells, specifically within SWRs (Fig 2D)

Sleep loss attenuates memory reactivation 305
Given that our results thus far demonstrate that SWRs and their overall population firing rates 306 are largely preserved in SD, we next asked whether the specific content of SWRs may be 307 impacted by sleep deprivation. We first examined the reactivation of neuronal ensembles, 308 which  ; Fig. 3A). A time-reversed EV (REV) was used to estimate the chance level 314 for reactivation 45,46 . In naturally sleeping animals following exposure to the novel maze we 315 observed hours long reactivation, consistent with our previous study 43 . During sleep 316 deprivation, however, we observed one of two scenarios: either virtually no reactivation (e.g. 317 rats N and U, Fig. 3A; seen in 4 out of 7 sessions, Extended Data Figure 1) or alternately, 318 reactivation somewhat similar to natural sleep but with a faster rate of decay (e.g. rats S and V, 319 Fig. 3A; seen in 3 out of 7 sessions, Extended Data Figure 1). Pooled across subjects, the overall 320 timescale of reactivation, estimated from the half-maximum of the EV autocorrelations ( Fig.  321  3B), was significantly longer in sleep compared to sleep deprivation (NSD mean ± standard 322 error of the mean (SEM) = 2.6 ± 0.38 h vs SD mean ± SEM = 1.5 ± 0.24 h, = 0.0376 , t-test 323 (df1 = 6, df2 = 7). Remarkably, while reactivation was nearly absent at the end of the sleep 324 deprivation period (Fig. 3C) it increased significantly at the onset of recovery sleep ( Fig. 3C; RS 325 mean (EV-REV) ± SEM = 0.026 ± .003 vs SD2 mean (EV-REV) ± SEM = 4.06 × 10 −3 ± 7.56 × 326 10 −3 , = 5.20 × 10 −3 , paired t-test (df = 7)). This suggests that the hippocampus is capable 327 of reprising ensemble patterns reactivation even after a pause, such as during sleep 328 deprivation. Nevertheless, the observed levels of reactivation during recovery sleep remained 329 substantially lower compared to a similar period during natural sleep ( Fig. 3C; RS mean (EV-330 REV) ± SEM = 0.026 ± .003, vs NS1 mean (EV-REV) ± SEM = 0.145 ± .033, = 0.0156 , t-331 test(df1 = 7, df2 = 6)), indicating a lasting outcome of sleep deprivation. 332

Sequence replay deteriorates during sleep deprivation and recovery sleep 333
While pairwise measures, such as EV, measure neuronal reactivation, finer scale analysis has 334 also revealed that neuronal activity during sharp-wave ripples can provide a temporally 335 compressed replay of sequences of place cells that fired during maze behavior 47,48 . We 336 observed similar replay sequences in our recordings as well (Fig. 4A). Most studies of sequence 337 replay have been primarily directed at the brief periods of rest and sleep occurring within an 338 hour of maze exposure. Taking advantage of our long duration recordings, we investigated how 339 sequential replay unfolds over several hours of sleep in comparison with sleep deprivation. As 340 quantification of these events can rely on different assumptions about the nature of replay 49,50 , 341 we focused on using Bayesian methods (Fig. 4 A-B) to simply quantify the proportion of ripple 342 events that decode continuous movement through the maze environment (i.e. "trajectory 343 replays"). Ripple events featuring ≥ 5 active units, animal's movement speed < 8 cm/s, and 344 peak ripple power > 1 s.d. were considered candidates for further analyses (see Methods). We 345 assessed trajectory structure using the distance between decoded locations in adjacent time 346 steps, referred to as "jump distance" 51,52 . Ripple events with jump distance < 40 cm in at least 347 three consecutive time bins were classified as trajectory replays, and we assessed the 348 distribution of these events across epochs and conditions. The proportion of ripples that 349 qualified as trajectory replays was highest on the maze in both experimental groups, consistent 350

361
The proportion of replays in recovery sleep was significantly lower than the equivalent period in natural 362 sleep (Wilcoxon rank-sum tests, *p < 0.05) 363 with previous reports 53,54 . However, the proportion of trajectory replays was significantly lower 364 in SD sessions compared to NSD sessions in the last two blocks (NS2 mean ± SEM = 0.27 ± 0.023 365 vs SD2 mean ± SEM = 0.19 ± 0.021, = 0.0213 , t-test (df1 = 6, df2 = 7); NS3 mean ± SEM = 366 0.26 ± 0.023 vs RS mean ± SEM = 0.17 ± 0.018, = 0.0178 , t-test (df1 = 7, df2 = 6)). 367 Importantly, even during recovery sleep, replays did not rebound to the comparative levels in 368 natural sleep ( Fig. 4C; RS mean ± SEM = 0.17 ± 0.018 vs NS1 mean ± SEM = 0.27 ± 0.033 = 369 0.0334, t-test (df1 = 7, df2 = 6) ). These results demonstrate that the loss of sleep immediately 370 following novel experience negatively impacts the hippocampal replay of place cell patterns 371 following novel maze exposure, which fail to rebound during recovery sleep. 372 to sleep deprivation, even though both states featured a similar incidence of SWRs. The 452 background brain states against which SWRs occur, along with the hippocampal activation 453 patterns that they produce, including the specific content of reactivation and replays, likely play 454 an role in determining their effects on the hippocampal circuit and other brain regions 8,56,72 . 455

Sleep loss impairs hippocampal reactivation and replay 456
Among the most significant findings uncovered in this study is that even though we observed a 457 similar number of SWRs during sleep and sleep deprivation, the hippocampal reactivations and 458 replays of the maze experience elicited during these events were diminished during sleep 459 deprivation compared to sleep. In several influential models of sleep-dependent memory 460 consolidation, hippocampal reactivations and replays work to consolidate memories by 461 reprising patterns to strengthen the connections between the neurons associated to a memory 462 73-77 . In the most recent formulation of the synaptic homeostasis hypothesis, as well, 463 reactivations and replays play a critical role by sparing indexed memories from synaptic 464 downscaling to improve the signal to noise of important circuit connections 70 . Despite the 465 consensus that these neuronal firing patterns play a critical role in the memory function of 466 sleep, little has been known until now about how they are impacted by sleep loss. We 467 measured reactivation using the EV measure, which reflects the similarity of pairwise co-firings 468 of neurons to their co-firings during the novel maze exposure 44 , while controlling for co-469 activations that are present prior to maze exposure 43,45 , consistent with the Hebbian principle 470 that assemblies formed during an experience continue to co-fire thereafter. Trajectory replays, 471 on the other hand, relate the positions sequentially decoded using Bayesian inference to the 472 sequence of locations that rats run through on the maze. Thus, replays presuppose the 473 presence of reactivation, but reactivation could be present in the absence of replay, so long as 474 active neurons fire in ensembles that are coherent with the maze experience 78,79 . In this study, 475 we found that reactivation during natural sleep lasted for several hours, consistent with our 476 recent report 43 . During sleep deprivation, on the other hand, we observed a bimodality, with 477 some sessions showing virtually no reactivation, while others showed reactivation the decayed 478 at a faster rate compared to during sleep. An intriguing possibility is that this bimodality reflects 479 differences in resilience to the effects of sleep deprivation 80,81 . However, we did not see 480 evidence for a similar bimodality in the amount of trajectory replays, which was significantly 481 lower by the second half of sleep deprivation, compared to natural sleep. This difference could 482 be due to the methodological differences in the measures used to capture reactivation and 483 replay, making a direct comparison very difficult 50 . A potential contribution to such differences, 484 however, could arise if pairwise co-activations during sleep-deprivation are reflective of the 485 maze experience, without linked into multi-neuronal sequences that decode to trajectories 486 spanning the maze environment 82,83 . Nevertheless, our study shows that both replay and 487 reactivation, each associated with the memory function of sleep 77,84,85 , were negatively 488 impacted by sleep deprivation. 489 The rebound of reactivation during recovery sleep 490 Remarkably, we observed a partial rebound in reactivation during recovery sleep following 491 sleep deprivation. This rebound suggests that despite the diminished reactivation during sleep 492 deprivation, the hippocampus maintained a latent trace of the maze experience that was 493 revived when the animals fell asleep. Importantly, however, this rebound was only partial, and 494 reactivation during the > 2.5 h of recovery sleep did not reach the levels observed during 495 natural sleep in non-deprived sessions. While it remains conceivable that rebound reactivation 496 could continue to increase beyond the duration of our recordings, this appears unlikely, 497 because the greatest synchrony consistent with reactivation is observed at the onset of sleep, 498 rather than during later stages when rodent sleep tends to be more fragmented and 499 reactivation patterns become more diffuse 26,43 . Notably, we also did not detect a similar 500 rebound in trajectory replays. Overall, the absence of a complete rebound in recovery sleep is 501 remarkable, because while most indices of brain health and function return to homeostatic 502 levels following sufficient recovery sleep, memories, once impaired by sleep loss or otherwise 503 do not typically recover 2,86-88 . It is noteworthy that cyclic AMP (cAMP) signaling that is 504 prominent in the first several hours of sleep and is impaired by sleep deprivation is fully 505 restored during recovery sleep 87,89 . Similarly full recovery is observed in the transcription of 506 genes that are differentially impacted by sleep deprivation following recovery sleep 88 , in 507 contrast to reactivation and replay as we report. An intriguing possibility is that the temporal 508 overlap between molecular signaling and replays is the key prerequisite for the consolidation of 509 memory. Sleep loss potentially dissociates these processes either by suppressing one or both 510 processes during the deprivation period, or by allowing for a full rebound in cAMP or other 511 molecular pathways but not reactivations and replays in the recovery sleep period. Four male and three female Long-Evans rats (300-500 grams) were used in this study. All 536 surgeries were performed on isoflurane anesthetized animals head fixed on a stereotaxic 537 frame. After removing hair from the head, the incision area was cleaned using alcohol and 538 betadine. Next, an incision was made to expose the skull underneath. The skull was cleaned of 539 tissues and blood, after which hydrogen peroxide was applied. Coordinates for probe 540 implantation were marked above the dorsal hippocampus (AP: -3.36 , ML: ±2.2) following 541 measurement of bregma and lambda. Craniotomies were drilled at the marked location. Using 542 a blunt needle, the dura was removed carefully to expose the brain surface. After cessation of 543 bleeding, animals were implanted with 64 channel (8 shank "Buzsaki" probe; Neuronexus, MI; X 544 animals) or 128 channel (8 shanks, Diagnostic Biochips, MD, 7-X animals) silicon probes. Ground 545 and reference screws were placed over the cerebellum. Craniotomy was covered with DOWSIL 546 silicone gel (3-4680, Dow Corning, Midland, MI) and wax. A copper mesh was built around the 547 implant for protection and electrical shielding. All procedures involving animals were approved 548 by the Animal Care and Use Committee at the University of Michigan. 549 Behavior 550 Prior to the probe implant surgery animals were habituated to the experimenter for ≥ 40 mins 551 for 5 days. Following habituation animals were water restricted and trained to associate water 552 rewards with plastic wells. During the post-implant recovery period (7 days) animals were 553 brought to the recording room for monitoring electrophysiology signals and probes were slowly 554 lowered to the dorsal CA1 region of the hippocampus. In addition, animals were also 555 habituated to sleep box for >1 h every day. Following this, animals were placed on a water 556 restriction regiment for 24 h before experiments commenced. Each experimental session began 557 by transferring animals to their sleep box ~4 h before the onset of light cycle. After 3 h of 558 recording in the home cage, animals were transferred to a novel maze that they had not 559 previously explored. These maze tracks were made distinct by the shape, color, and 560 construction materials. Animals alternated for ~ 1 h between two water wells fixed at either 561 ends of the maze to retrieve rewards from water wells. Following exploration, animals were 562 transferred to the home cage and the recording continued for ≥ 10 h. Animals had access to ad 563 libitum food and received ad libitum water for 30 mins per day. 564

Sleep deprivation protocol 565
Sleep deprivation was performed at the onset of the light cycle in the home cage using a 566 standard 'gentle handling' procedure 92,93 . Animals were extensively habituated to the 567 experimenter conducting the sleep deprivation. During the initial hours of sleep deprivation, 568 animals were kept awake by mild noises, tapping or gentle shaking of the cage when animals 569 displayed signs of sleepiness . As sleep pressure built up over 5h sleep deprivation period, other  570  techniques such as gently stroking the animal's body with soft brush or disturbing bedding were  571 increasingly employed to to ensure that animals stayed awake. Following sleep deprivation, 572 animals were allowed to sleep and recover for 48 h before any further experiments. 573

Data Acquisition 574
Electrophysiology data was acquired using OpenEphys 94 or an Intan RHD recording controller 575 sampled at 30 kHz. Analysis of local field potentials (LFP) , was performed on signals 576 downsampled to 1250 Hz. The animal's position on the maze track was obtained using 577 Optritrack (NaturalPoint, Inc, OR), which uses infrared cameras to locate a 3d markers that 578 were clipped to the animal's crown. Position data was sampled at either 60 Hz or 120 Hz and 579 later interpolated for aligning with electrophysiology. Water rewards during alternation on the 580 maze track were delivered via solenoids interfaced with custom built hardware using Arduino. 581 The timestamps for water delivery were recorded via TTLs. 582 Spike sorting and neuron type classification 583 All data went through filtering, thresholding and automatically sorting using SpyKING CIRCUS 95 , 584 followed by manual inspection and reclustering using the Phy package 585 (https://github.com/cortex-lab/phy/}. Only well isolated units were used in further analysis. 586 Putative neurons were classified into pyramidal and interneurons based on peak waveform 587 shape, firing rate, and interspike-interval. To ensure that a given neuron was reliably tracked 588 across the recording duration, we divided each session into 5 equally sized bins (~2.5 h) and 589 excluded any unit that fired below 25% of its overall mean in any given time bin. All LFP and 590 unit analyses were performed using custom codes written in PYTHON and are available in our 591 lab's GitHub repository (https://github.com/diba-lab/NeuroPy). 592

Sharp wave ripple detection and related properties 593
For detecting ripples, one channel from each shank were selected based on the (highest) mean 594 power in the ripple frequency band (125-250 Hz). The Hilbert amplitude was averaged across all 595 selected channels, then smoothed using a Gaussian kernel ( = 12.5 ) and z-scored. 596 Putative ripple epochs were identified from timepoints exceeding 2.5 standard deviations (s.d.) 597 and the start/stop was associated with signals > 0.5 s.d.. Candidate ripples < 50 ms or > 450 ms 598 were excluded from further analyses. Sharp wave amplitudes were obtained from a bandpass 599 (2-30 Hz) filtered LFP using the difference between maximum and minimum value across all 600 recorded channels within a given ripple. The peak frequency of each ripple was estimated using 601 a complex wavelet transform. The LFP was first high-pass filtered > 100 Hz. This filtered signal 602 was then convolved with complex Morlet wavelets with central frequencies selected from 603 linearly spaced frequencies in the ripple frequency band (100 to 250 Hz). Within each ripple, 604 the frequency with maximum absolute wavelet power was designated as the peak ripple 605 frequency. 606

Sleep scoring 607
Sleep scoring was performed using correlation EMG, theta, and delta power. Correlation EMG 608 was estimated by summing pairwise correlations across all channels calculated in 10 s time 609 windows with a 1 s step 96,97 . For theta power, a recording channel with the highest mean 610 power in the 5-10 Hz theta frequency band was identified. Following theta channel selection, 611 the power spectral density was calculated for each window. Periods with low and high EMG 612 power were labeled as sleep and wake, respectively. The theta (5-10 Hz) over delta (1-4 Hz) 613 plus (10 -14 Hz) band ratio of the power spectral density was used to detect transitions 614 between high theta and low theta, using custom python software based on hidden Markov 615 models followed by visual inspection. Sleep states with high theta were classified as rapid eye 616 movement (REM) and the remainder were classified as non-REM (NREM). Wake periods with 617 high theta were labeled as "active" and the remaining were labeled "quiet". These labels were 618 merged in WAKE for the main figures. All detected states went through additional visual 619 inspection to correct any misclassifications. 620 Explained variance measure for reactivation 621 Explained variance was calculated using previously described methods 43,44 . Briefly, spike times 622 were binned into 250 ms time bins, creating an N byT matrix, where N is the number of neurons 623 and T is the number of time bins. Pearson's correlations, R, were determined for spike counts 624 from neuronal pairs in 15 min sliding windows (window length 15 min, sliding 5 min steps) to 625 produce P, an M-dimensional vector, where M is the number of cell pairs. To reduce spurious 626 correlations arising from cross contamination of units from the same shank, only pairs with 627 waveform similarity <0.8 were used. Next, to assess similarity between P vectors from different 628 windows, the Pearson correlation R of these vectors (i.e., the correlation between cell pair 629 correlations) was determined (e.g., R we used the half-maximum of the autocorrelation function of EV. 638

Place field calculations 639
Prior to calculating place fields, animals' 2D positions were linearized using ISOMAP 98 and 640 visually inspected to ensure accuracy. For each unit, two firing rate maps were generated 641 corresponding to each running direction. Occupancy within 2 cm spatial bins using timepoints 642 when animal's speed exceeded 8 cm/s were calculated and smoothed with a Gaussian kernel 643 (sigma = 4 cm). For each neuron, spike counts within each spatial bin were determined and also 644 smoothed with the Gaussian kernel (sigma = 4 cm). Then, each neuron's firing rate map was 645 generated by dividing the smoothed spike counts by the smoothed occupancy map. Neurons 646 with peak firing rate < 0.5 Hz were excluded from further analysis. 647

Decoding and sequence selection 648
Multiunit activity (MUA) was used to detect population burst events that are concurrent with 649 sharp-wave ripples. Within a session, all putative spikes from all clusters were binned in 1 ms 650 time bin and smoothed using a Gaussian kernel of = 20 ms. Candidate ripple events were 651 identified if peak MUA activity exceeded 3 s.d.. The start and stop times were defined by 652 extending the boundary to MUA above the mean. Two events occurring within 10 ms of each 653 other were merged. Events with duration < 80 ms or > 500 ms were discarded. 654 Before decoding, candidate ripple events were required to satisfy 1) ≥ 5 active units, 2) 655 movement speed < 8 cm/s, and 3) concurrent peak ripple power > 1 s.d.. For these analyses 656 alone, to minimize decoding error, we included all stable clusters 99 . Position decoding was 657 carried out on ripple events using Bayesian decoding 100 . Probabilities of the animal occupying 658 each position bin on the track were calculated according to: 659 where is the duration of the time bin (20 ms) used, � � is the firing rate of the i-th neuron 661 at on the maze, is a normalization constant such that sum of probabilities across all 662 position bins equals to 1 for each time bin, and is the number of spikes fired by each neuron 663 in that bin. Location with the maximum posterior probability in a given time bin was termed as 664 that time bin's `decoded location`.